package com.hz.friends.chat.entity;

import java.io.Serializable;
import java.util.Date;

import android.graphics.Bitmap;
import android.text.TextUtils;

import com.avos.avoscloud.AVUser;
import com.hz.friends.db.DBContactUser;

public class IMChatMessage implements Serializable{
	private int messageType = MessageType.TXT;
	private String messageContent;      // 消息内容文本
	private String messageContentTrans;      // 消息内容文本翻译
	private boolean tranflag = false;   //是否翻译
	private Bitmap  thumbImage  = null; //视频、图片缩略图
	private String mediaUrl = null;//视频、图片、声音url 
	private String mediaPath = null;//视频、图片、声音path
	private int mediaduration = 0; // 秒为单位 声音、视频长度
	private int isRead = STATE_UNREAD; // 消息是否已读 0:未读，1：已读
	private int imState = STATE_IM_SENDING; // 消息的状态
	private int messageDirection = IMChatMessage.MessageDirect.SENT; //消息为发送的或接收的
	private Date messagetime = null; //消息时间
//	private AVUser fromuser = null;    
	private DBContactUser fromuser = null;
//	private String dateCreated; // 服务器时间
//	private Date curDate; // 本地时间
	private String messageId = ""; // 消息id
//	private String sessionId; // 会话id
//	private String groupSender; // 消息的发送者
	
	private int imageWidth = 0; //图片宽
	private int imageHeight = 0; //图片高
	
	// 消息已读未读状态
	public static final int STATE_UNREAD = 0;
	public static final int STATE_READED = 1;
	
	// 消息的状态
	public static final int STATE_IM_SENDING = 0;
	public static final int STATE_IM_SEND_SUCCESS = 1;
	public static final int STATE_IM_SEND_FAILED = 2;
	public static final int STATE_IM_RECEIVEED = 3;
	
	public String getMessageContentTrans() {
		return messageContentTrans;
	}

	public void setMessageContentTrans(String messageContentTrans) {
		this.messageContentTrans = messageContentTrans;
	}

	public Bitmap getThumbImage() {
		return thumbImage;
	}

	public void setThumbImage(Bitmap thumbImage) {
		this.thumbImage = thumbImage;
	}

	public String getMediaPath() {
		return mediaPath;
	}

	public void setMediaPath(String mediaPath) {
		this.mediaPath = mediaPath;
	}

	public int getIsRead() {
		return isRead;
	}

	public void setIsRead(int isRead) {
		this.isRead = isRead;
	}

	public int getImageWidth() {
		return imageWidth;
	}

	public void setImageWidth(int imageWidth) {
		this.imageWidth = imageWidth;
	}

	public int getImageHeight() {
		return imageHeight;
	}

	public void setImageHeight(int imageHeight) {
		this.imageHeight = imageHeight;
	}

	public String getMediaUrl() {
		return mediaUrl;
	}

	public void setMediaUrl(String mediaUrl) {
		this.mediaUrl = mediaUrl;
	}

 
	public int getMessageDirection() {
		return messageDirection;
	}

	public void setMessageDirection(int messageDirection) {
		this.messageDirection = messageDirection;
	}

//	public String getGroupSender() {
//		return groupSender;
//	}
//
//	public void setGroupSender(String groupSender) {
//		this.groupSender = groupSender;
//	}
//
//	public String getSessionId() {
//		return sessionId;
//	}
//
//	public void setSessionId(String sessionId) {
//		this.sessionId = sessionId;
//	}

	public long getMediaduration() {
		return mediaduration;
	}

	public void setMediaduration(int mediaduration) {
		this.mediaduration = mediaduration;
	}


	public int getImState() {
		return imState;
	}

	public void setImState(int imState) {
		this.imState = imState;
	}

//	public String getDateCreated() {
//		return dateCreated;
//	}
//
//	public void setDateCreated(String dateCreated) {
//		this.dateCreated = dateCreated;
//	}
//
//	public Date getCurDate() {
//		return curDate;
//	}
//
//	public void setCurDate(Date curDate) {
//		this.curDate = curDate;
//	}

	public String getMessageId() {
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}

 
	public DBContactUser getFromuser() {
		return fromuser;
	}

	public void setFromuser(DBContactUser fromuser) {
		this.fromuser = fromuser;
	}

	public Date getMessagetime() {
		return messagetime;
	}

	public void setMessagetime(Date messagetime) {
		this.messagetime = messagetime;
	}

	public boolean isTranflag() {
		return tranflag;
	}

	public void setTranflag(boolean tranflag) {
		this.tranflag = tranflag;
	}

	public int getMessageType() {
		return messageType;
	}

	public void setMessageType(int messageType) {
		this.messageType = messageType;
	}


	public String getMessageContent() {
		return messageContent;
	}

	public void setMessageContent(String messageContent) {
		this.messageContent = messageContent;
	}



	public static class MessageType {
		public final static int TXT = 0;
		public final static int IMAGE = 1;
		public final static int VOICE = 2;
		public final static int VIDEO = 3;
		public final static int GROUPINVITE = 4;//群邀请
	}

	public static class MessageDirect {
		public final static int RECEIVE = 0;
		public final static int SENT = 1;
	}

	
}
